public class CarFactory {
    public static Car createCar(String type) {
        Car car = null;
        if (type.equalsIgnoreCase("sedan")) {
            car = new SedanCar();
        } else if (type.equalsIgnoreCase("suv")) {
            car = new SUV();
        } else if (type.equalsIgnoreCase("truck")) {
            car = new TruckCar();
        }
        return car;
    }
}
